package com.weishu.controller;


import com.github.pagehelper.PageInfo;
import com.weishu.domain.TSfContract;
import com.weishu.service.ITSfContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 * 收房合同
 * @author liyan
 * @since 2021-07-31
 */
@RestController
@RequestMapping("/tSfContract")
public class TSfContractController {

    @Autowired
    private ITSfContractService contractService;
    //查询金额
    @RequestMapping("getbalance")
    public TSfContract getbalance(Integer id){
        TSfContract sfContract=contractService.getbalance(id);
        return sfContract;
    }
    //查询
    @RequestMapping("list")
    public PageInfo<TSfContract> list(@RequestBody TSfContract sfContract){
        PageInfo<TSfContract> info=contractService.select(sfContract);
        return info;
    }
    //查询金融产品
    @RequestMapping("plist")
    public List<TSfContract> plist(){
        List<TSfContract> list=contractService.plist();
        return list;
    }
    //根据ic查询对应的数据
    @RequestMapping("getByid")
    public TSfContract getByid(Integer productId){
        TSfContract sfContract=contractService.getBypid(productId);
        System.err.println(sfContract);
        return sfContract;
    }
}

